

<script language="JavaScript" type="text/JavaScript">
<!--
	function addtag(tag) {
		var txt = document.getElementById('texte');
		if(document.selection) {
			txt.focus();
			sel = document.selection.createRange();
			sel.text = '<' + tag + '>' + sel.text + '</' + tag + '>';
		} else if(txt.selectionStart || txt.selectionStart == '0') {	
			txt.value = (txt.value).substring(0, txt.selectionStart) + "<"+tag+">" + (txt.value).substring(txt.selectionStart, txt.selectionEnd) + "</"+tag+">" + (txt.value).substring(txt.selectionEnd, txt.textLength);
		} else {
			txt.value = '<' + tag + '></' + tag + '>';
		}
		return;
	}
//-->
</script>

<script language="JavaScript" type="text/JavaScript">
<!--
	function addurltag() {
		var txt = document.getElementById('texte');
		var link = prompt("Type the address:", "http://");
		if(link.length == 0 || link == "http://") {
			return;
		} else {
			var link = "=" + link;
			var text;
			var sel2 = "";
			if(document.selection) {
				txt.focus();
				sel = document.selection.createRange();
				sel2 = sel.text;
			} else if(txt.selectionStart || txt.selectionStart == '0') {
				sel2 = (txt.value).substring(txt.selectionStart, txt.selectionEnd);
			}
			if(sel2.length > 0) {
				text = sel2;
			} else {
				text = prompt("Enter the link text:", "");
			}
		}
		if(document.selection) {
			txt.focus();
			sel = document.selection.createRange();
			sel.text = "[url" + link + "]" + text + "[/url]";
		} else {
			txt.value = (txt.value).substring(0, txt.selectionStart) + "[url" + link + "]" + text + "[/url]" + (txt.value).substring(txt.selectionEnd, txt.textLength);
		}
		return;
	}
//-->
</script>

